home *** CD-ROM | disk | FTP | other *** search
- <refentry id="libgimp-gimpgradients" revision="19 Jan 2001">
- <refmeta>
- <refentrytitle>gimpgradients</refentrytitle>
- <manvolnum>3</manvolnum>
- <refmiscinfo>LIBGIMP Library</refmiscinfo>
- </refmeta>
-
- <refnamediv>
- <refname>gimpgradients</refname><refpurpose></refpurpose>
- </refnamediv>
-
- <refsynopsisdiv><title>Synopsis</title>
- <synopsis>
-
-
-
- <link linkend="gchar">gchar</link>** <link linkend="gimp-gradients-get-list">gimp_gradients_get_list</link> (<link linkend="gint">gint</link> *num_gradients);
- <link linkend="gchar">gchar</link>* <link linkend="gimp-gradients-get-active">gimp_gradients_get_active</link> (void);
- <link linkend="gboolean">gboolean</link> <link linkend="gimp-gradients-set-active">gimp_gradients_set_active</link> (<link linkend="gchar">gchar</link> *name);
- <link linkend="gdouble">gdouble</link>* <link linkend="gimp-gradients-sample-uniform">gimp_gradients_sample_uniform</link> (<link linkend="gint">gint</link> num_samples);
- <link linkend="gdouble">gdouble</link>* <link linkend="gimp-gradients-sample-custom">gimp_gradients_sample_custom</link> (<link linkend="gint">gint</link> num_samples,
- <link linkend="gdouble">gdouble</link> *positions);
- <link linkend="gchar">gchar</link>* <link linkend="gimp-gradients-get-gradient-data">gimp_gradients_get_gradient_data</link>
- (<link linkend="gchar">gchar</link> *name,
- <link linkend="gint">gint</link> *width,
- <link linkend="gint">gint</link> sample_size,
- <link linkend="gdouble">gdouble</link> **grad_data);
- <link linkend="gboolean">gboolean</link> <link linkend="gimp-gradients-popup">gimp_gradients_popup</link> (<link linkend="gchar">gchar</link> *gradients_callback,
- <link linkend="gchar">gchar</link> *popup_title,
- <link linkend="gchar">gchar</link> *initial_gradient,
- <link linkend="gint">gint</link> sample_size);
- <link linkend="gboolean">gboolean</link> <link linkend="gimp-gradients-close-popup">gimp_gradients_close_popup</link> (<link linkend="gchar">gchar</link> *gradients_callback);
- <link linkend="gboolean">gboolean</link> <link linkend="gimp-gradients-set-popup">gimp_gradients_set_popup</link> (<link linkend="gchar">gchar</link> *gradients_callback,
- <link linkend="gchar">gchar</link> *gradient_name);
- </synopsis>
- </refsynopsisdiv>
-
-
-
-
-
- <refsect1>
- <title>Description</title>
- <para>
-
- </para>
- </refsect1>
-
- <refsect1>
- <title>Details</title>
- <refsect2>
- <title><anchor id="gimp-gradients-get-list">gimp_gradients_get_list ()</title>
- <programlisting><link linkend="gchar">gchar</link>** gimp_gradients_get_list (<link linkend="gint">gint</link> *num_gradients);</programlisting>
- <para>
- Retrieve the list of loaded gradients.
- </para>
- <para>
- This procedure returns a list of the gradients that are currently
- loaded in the gradient editor. You can later use the
- gimp_gradients_set_active function to set the active gradient.</para>
- <para>
-
- </para><informaltable pgwide=1 frame="none" role="params">
- <tgroup cols="2">
- <colspec colwidth="2*">
- <colspec colwidth="8*">
- <tbody>
- <row><entry align="right"><parameter>num_gradients</parameter> :</entry>
- <entry> The number of loaded gradients.
- </entry></row>
- <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> The list of gradient names.
- </entry></row>
- </tbody></tgroup></informaltable></refsect2>
- <refsect2>
- <title><anchor id="gimp-gradients-get-active">gimp_gradients_get_active ()</title>
- <programlisting><link linkend="gchar">gchar</link>* gimp_gradients_get_active (void);</programlisting>
- <para>
- Retrieve the name of the active gradient.
- </para>
- <para>
- This procedure returns the name of the active gradient in the
- gradient editor.</para>
- <para>
-
- </para><informaltable pgwide=1 frame="none" role="params">
- <tgroup cols="2">
- <colspec colwidth="2*">
- <colspec colwidth="8*">
- <tbody>
- <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> The name of the active gradient.
- </entry></row>
- </tbody></tgroup></informaltable></refsect2>
- <refsect2>
- <title><anchor id="gimp-gradients-set-active">gimp_gradients_set_active ()</title>
- <programlisting><link linkend="gboolean">gboolean</link> gimp_gradients_set_active (<link linkend="gchar">gchar</link> *name);</programlisting>
- <para>
- Sets the specified gradient as the active gradient.
- </para>
- <para>
- This procedure lets you set the specified gradient as the active or
- \"current\" one. The name is simply a string which corresponds to
- one of the loaded gradients in the gradient editor. If no matching
- gradient is found, this procedure will return an error. Otherwise,
- the specified gradient will become active and will be used for
- subsequent custom gradient operations.</para>
- <para>
-
- </para><informaltable pgwide=1 frame="none" role="params">
- <tgroup cols="2">
- <colspec colwidth="2*">
- <colspec colwidth="8*">
- <tbody>
- <row><entry align="right"><parameter>name</parameter> :</entry>
- <entry> The name of the gradient to set.
- </entry></row>
- <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> TRUE on success.
- </entry></row>
- </tbody></tgroup></informaltable></refsect2>
- <refsect2>
- <title><anchor id="gimp-gradients-sample-uniform">gimp_gradients_sample_uniform ()</title>
- <programlisting><link linkend="gdouble">gdouble</link>* gimp_gradients_sample_uniform (<link linkend="gint">gint</link> num_samples);</programlisting>
- <para>
- Sample the active gradient in uniform parts.
- </para>
- <para>
- This procedure samples the active gradient from the gradient editor
- in the specified number of uniform parts. It returns a list of
- floating-point values which correspond to the RGBA values for each
- sample. The minimum number of samples to take is 2, in which case
- the returned colors will correspond to the { 0.0, 1.0 } positions in
- the gradient. For example, if the number of samples is 3, the
- procedure will return the colors at positions { 0.0, 0.5, 1.0 }.</para>
- <para>
-
- </para><informaltable pgwide=1 frame="none" role="params">
- <tgroup cols="2">
- <colspec colwidth="2*">
- <colspec colwidth="8*">
- <tbody>
- <row><entry align="right"><parameter>num_samples</parameter> :</entry>
- <entry> The number of samples to take.
- </entry></row>
- <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> Color samples: { R1, G1, B1, A1, ..., Rn, Gn, Bn, An }.
- </entry></row>
- </tbody></tgroup></informaltable></refsect2>
- <refsect2>
- <title><anchor id="gimp-gradients-sample-custom">gimp_gradients_sample_custom ()</title>
- <programlisting><link linkend="gdouble">gdouble</link>* gimp_gradients_sample_custom (<link linkend="gint">gint</link> num_samples,
- <link linkend="gdouble">gdouble</link> *positions);</programlisting>
- <para>
- Sample the active gradient in custom positions.
- </para>
- <para>
- This procedure samples the active gradient from the gradient editor
- in the specified number of points. The procedure will sample the
- gradient in the specified positions from the list. The left endpoint
- of the gradient corresponds to position 0.0, and the right endpoint
- corresponds to 1.0. The procedure returns a list of floating-point
- values which correspond to the RGBA values for each sample.</para>
- <para>
-
- </para><informaltable pgwide=1 frame="none" role="params">
- <tgroup cols="2">
- <colspec colwidth="2*">
- <colspec colwidth="8*">
- <tbody>
- <row><entry align="right"><parameter>num_samples</parameter> :</entry>
- <entry> The number of samples to take.
- </entry></row>
- <row><entry align="right"><parameter>positions</parameter> :</entry>
- <entry> The list of positions to sample along the gradient.
- </entry></row>
- <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> Color samples: { R1, G1, B1, A1, ..., Rn, Gn, Bn, An }.
- </entry></row>
- </tbody></tgroup></informaltable></refsect2>
- <refsect2>
- <title><anchor id="gimp-gradients-get-gradient-data">gimp_gradients_get_gradient_data ()</title>
- <programlisting><link linkend="gchar">gchar</link>* gimp_gradients_get_gradient_data
- (<link linkend="gchar">gchar</link> *name,
- <link linkend="gint">gint</link> *width,
- <link linkend="gint">gint</link> sample_size,
- <link linkend="gdouble">gdouble</link> **grad_data);</programlisting>
- <para>
-
- </para><informaltable pgwide=1 frame="none" role="params">
- <tgroup cols="2">
- <colspec colwidth="2*">
- <colspec colwidth="8*">
- <tbody>
- <row><entry align="right"><parameter>name</parameter> :</entry>
- <entry></entry></row>
- <row><entry align="right"><parameter>width</parameter> :</entry>
- <entry></entry></row>
- <row><entry align="right"><parameter>sample_size</parameter> :</entry>
- <entry></entry></row>
- <row><entry align="right"><parameter>grad_data</parameter> :</entry>
- <entry></entry></row>
- <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry>
-
- </entry></row>
- </tbody></tgroup></informaltable></refsect2>
- <refsect2>
- <title><anchor id="gimp-gradients-popup">gimp_gradients_popup ()</title>
- <programlisting><link linkend="gboolean">gboolean</link> gimp_gradients_popup (<link linkend="gchar">gchar</link> *gradients_callback,
- <link linkend="gchar">gchar</link> *popup_title,
- <link linkend="gchar">gchar</link> *initial_gradient,
- <link linkend="gint">gint</link> sample_size);</programlisting>
- <para>
- Invokes the Gimp gradients selection.
- </para>
- <para>
- This procedure popups the gradients selection dialog.</para>
- <para>
-
- </para><informaltable pgwide=1 frame="none" role="params">
- <tgroup cols="2">
- <colspec colwidth="2*">
- <colspec colwidth="8*">
- <tbody>
- <row><entry align="right"><parameter>gradients_callback</parameter> :</entry>
- <entry> The callback PDB proc to call when gradient selection is made.
- </entry></row>
- <row><entry align="right"><parameter>popup_title</parameter> :</entry>
- <entry> Title to give the gradient popup window.
- </entry></row>
- <row><entry align="right"><parameter>initial_gradient</parameter> :</entry>
- <entry> The name of the pattern to set as the first selected.
- </entry></row>
- <row><entry align="right"><parameter>sample_size</parameter> :</entry>
- <entry> Size of the sample to return when the gradient is changed.
- </entry></row>
- <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> TRUE on success.
- </entry></row>
- </tbody></tgroup></informaltable></refsect2>
- <refsect2>
- <title><anchor id="gimp-gradients-close-popup">gimp_gradients_close_popup ()</title>
- <programlisting><link linkend="gboolean">gboolean</link> gimp_gradients_close_popup (<link linkend="gchar">gchar</link> *gradients_callback);</programlisting>
- <para>
- Popdown the Gimp gradient selection.
- </para>
- <para>
- This procedure closes an opened gradient selection dialog.</para>
- <para>
-
- </para><informaltable pgwide=1 frame="none" role="params">
- <tgroup cols="2">
- <colspec colwidth="2*">
- <colspec colwidth="8*">
- <tbody>
- <row><entry align="right"><parameter>gradients_callback</parameter> :</entry>
- <entry> The name of the callback registered for this popup.
- </entry></row>
- <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> TRUE on success.
- </entry></row>
- </tbody></tgroup></informaltable></refsect2>
- <refsect2>
- <title><anchor id="gimp-gradients-set-popup">gimp_gradients_set_popup ()</title>
- <programlisting><link linkend="gboolean">gboolean</link> gimp_gradients_set_popup (<link linkend="gchar">gchar</link> *gradients_callback,
- <link linkend="gchar">gchar</link> *gradient_name);</programlisting>
- <para>
- Sets the current gradient selection in a popup.
- </para>
- <para>
- Sets the current gradient selection in a popup.</para>
- <para>
-
- </para><informaltable pgwide=1 frame="none" role="params">
- <tgroup cols="2">
- <colspec colwidth="2*">
- <colspec colwidth="8*">
- <tbody>
- <row><entry align="right"><parameter>gradients_callback</parameter> :</entry>
- <entry> The name of the callback registered for this popup.
- </entry></row>
- <row><entry align="right"><parameter>gradient_name</parameter> :</entry>
- <entry> The name of the gradient to set as selected.
- </entry></row>
- <row><entry align="right"><emphasis>Returns</emphasis> :</entry><entry> TRUE on success.
- </entry></row>
- </tbody></tgroup></informaltable></refsect2>
-
- </refsect1>
-
-
-
-
- </refentry>
-